import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    curNav: JSON.parse(localStorage.getItem('currentNav')) || { bgColor: '#ff0000', path: '/', title: '剧集' },
  },
  mutations: {
    changeNav(state, nav) {
      state.curNav = nav
      localStorage.setItem('currentNav', JSON.stringify(nav))
    }
  },
  actions: {
  },
  modules: {
  }
})
